package day01;

import java.util.Scanner;

public class cccc {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        System.out.println("使用next方式接收：");
        if (scan.hasNext()){
            String str = scan.next();
            System.out.println("输入的内容为："+str);
        }
        scan.close();


        /*Scanner scan = new Scanner(System.in);
        System.out.println("使用nextLine方式接收：");
        if (scan.hasNextLine()) {
            String str = scan.nextLine();
            System.out.println("输入的内容为：" + str);
        }
        scan.close();*/
    }
}